import { useSignal } from '@preact/signals';
import { Namespace } from '@ibiz-template/scss-utils';
import './example-component.scss';

const ns = new Namespace('example-component');

export const ExampleComponent = () => {
  const count = useSignal<number>(0);

  const clickHandler = () => {
    count.value += 1;
  };

  return (
    <div className={ns.b()}>
      <div className={ns.e('count')}>{count}</div>
      <button className={ns.e('button')} onClick={clickHandler}>
        点击增加计数
      </button>
    </div>
  );
};

export default ExampleComponent;
